<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        $adminUsers = 'packages';
        Schema::create($adminUsers, function (Blueprint $table) {
            $table->engine = 'InnoDB';
            $table->increments('id');
            $table->string('name')->comment('名字');
            $table->string('description')->comment('描述');
            $table->dateTime('expired_at')->comment('有效期');
            $table->tinyInteger('status')->default(1)->comment('1 启动，0 禁用');
            $table->softDeletesDatetime();
            $table->datetimes();
        });

        DB::statement("ALTER TABLE `{$adminUsers}` comment '权限套餐表'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('packages');
    }
};
